package edu.sctu.xialei.june.day20150607one;

/**
 * Created by Administrator on 6/7/2015.
 */
public class Timer implements Runnable {


    @Override
    public void run() {

        int days = 0;
        int hours = 0;
        int minutes = 0;


        for (int i = 0; ; i++) {

            for (int j = 0; j < 1000; ) {
                try {
                    System.out.print(j + "    ");
                    Thread.sleep(100);
                    j = j + 100;
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }

            if (i == 60) {
                minutes++;
                i = 0;
            }
            if (minutes == 60) {
                hours++;
                minutes = 0;
            }
            if (hours == 24) {
                days++;
                hours = 0;
            }

            System.out.print("         ");
            System.out.println(days + "天 " + hours + "时 " + minutes + "分 " + i + "秒 ");
        }
    }
}
